#include <stdio.h>
#include <memory.h>
#include <stdlib.h> 
#include <unistd.h>

int main(){
   char ch[100];
   char* label = "-\\|/";
   memset(ch,'\0',sizeof(ch));
   int i = 0;
   while(i <= 100){
      printf("[%-100s][%d%%][%c]\r",ch,i,label[i%4]);
      fflush(stdout);
      ch[i++] = '#';
      usleep(50000);
   }
   printf("\n");
   return 0;
}
